xen/libxc: set CPUID topology leaf as unsupported for PV guests
authorDavid Vrabel <david.vrabel@citrix.com>
Sat, 16 Jul 2011 08:05:45 +0000 (09:05 +0100)
committerDavid Vrabel <david.vrabel@citrix.com>
Sat, 16 Jul 2011 08:05:45 +0000 (09:05 +0100)
The result of a CPUID Extended Topology Enumeration leaf for PV guests
is invalid as the level in ECX is ignored.  This can cause some guests
to loop endlessly when trying to enumerate the topology.

Since the physical topology isn't useful to PV guests set the topology
leaf as unsupported.

Guests affected include Linux kernels prior 2.6.32 where a workaround
was applied ("xen: mask extended topology info in cpu",
82d6469916c6fcfa345636a49004c9d1753905d1).

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
tools/libxc/xc_cpuid_x86.c
xen/arch/x86/traps.c

index d95baf5403ae669aa71e885e3c4308f6a2f6df5a..2b3602001d270982c379f841a2367d0925b2ba8f 100644 (file)
@@ -518,6 +518,7 @@ static void xc_cpuid_pv_policy(
 
     case 5: /* MONITOR/MWAIT */
     case 0xa: /* Architectural Performance Monitor Features */
+    case 0x0000000b: /* Extended Topology Enumeration */
     case 0x8000000a: /* SVM revision and features */
     case 0x8000001b: /* Instruction Based Sampling */
     case 0x8000001c: /* Light Weight Profiling */
index 266db18b491dcc57d39ebb19aa63d8633ad1bd26..977ba3a60db319baaecded2f0213a0508a71f610 100644 (file)
@@ -861,6 +861,7 @@ static void pv_cpuid(struct cpu_user_regs *regs)
         /* fall through */
     case 5: /* MONITOR/MWAIT */
     case 0xa: /* Architectural Performance Monitor Features */
+    case 0x0000000b: /* Extended Topology Enumeration */
     case 0x8000000a: /* SVM revision and features */
     case 0x8000001b: /* Instruction Based Sampling */
     case 0x8000001c: /* Light Weight Profiling */